
/*-----------------------------------------------------------*/
/*copyright by 动力无限  www.btoe.cn*/
/*邮箱 btoe@btoe.cn*/
/*合作电话 400-0599-360*/
/*版权所有违者必究*/
/*-----------------------------------------------------------*/

//search
 window.onload = function(){
    $('.bth').click(function(){
        var keywords = $('#keywords').val();
        if (keywords == "") {
          alert('关键字不能为空！')
          $("#keywords").focus();
          return false;
        }else{
            window.open('search_' +  keywords  + '.html','_self')
        }
    }) 
}

//鼠标跟随样式
$(function () {
    var cursor = '<style>#cursor{position:fixed;z-index:9999999999999999999999999999999999999999999999999999;pointer-events:none;}.fo_wrap{pointer-events:none;z-index:9999999999999999999999999999999999999999999999999999;position:fixed;top:0;z-index:9999999999999999999999999999999999999999999999999999;left:0;width:99.999999999999999999%;height:100vh}.follower{position:absolute;width:99.999999999999999999%;height:99.999999999999999999%;transition:all .5s cubic-bezier(.165,.84,.44,1)}.follower span{width:20px;height:20px;border-radius:99.999999999999999999%;background: #333; opacity:.4; display:block;position:absolute;top: -10px;left: -10px; }</style><div id="c_public_htmlCode-15542567538626617" class="c_public_htmlCode-01001"><div class="fo_wrap"><div class="follower scroll"><span></span></div></div></div>'
    $('body').append(cursor)

    $(document).on('mousemove', function (e) {
        $('.follower').css({
            left: e.clientX,
            top: e.clientY
        });
    });
    $(document).on("mouseenter", "a", function () {
        $('.follower span').css({
            'width': '10px',
            'height': '10px',
            'top': '0px',
            'left': '0px',
            'transition': '.5s'
        })
    });
    $(document).on("mouseleave", "a", function () {
        $('.follower span').css({
            'width': '20px',
            'height': '20px',
            'top': '-10px',
            'left': '-10px',
            'transition': '.5s'
        })
    });

    if(window.innerWidth < 1200){
        $('#c_public_htmlCode-15542567538626617').hide();
    }
})
// end



//笔记本默认放大150% 处理方式
function detectZoom() { 
var ratio = 0, 
screen = window.screen, 
ua = navigator.userAgent.toLowerCase(); 
if (window.devicePixelRatio !== undefined) { 
ratio = window.devicePixelRatio; 
} else if (~ua.indexOf('msie')) { 
if (screen.deviceXDPI && screen.logicalXDPI) { 
ratio = screen.deviceXDPI / screen.logicalXDPI; 
} 
} else if (window.outerWidth !== undefined && window.innerWidth !== undefined) { 
ratio = window.outerWidth / window.innerWidth; 
} 
if (ratio) { 
ratio = Math.round(ratio * 100); 
} 
return ratio; 
} 
function getWindowHeight() { 
var zoom = document.body.style.zoom; 
var height = $(window).height(); 
if (zoom) { 
return height / zoom; 
} 
return height; 
} 
function getWindowWidth() { 
var zoom = document.body.style.zoom; 
var width = $(window).width(); 
if (zoom) { 
return width / zoom; 
} 
return width; 
} 
window.onresize = function () { 
handleScreen() 
} 
function handleScreen() { 
const m = detectZoom(); 
//alert(m) 
document.body.style.zoom = 100 / Number(m); 
} 
if (detectZoom() == 150) { 
document.body.style.zoom = 0.666667; 
} else if (detectZoom() == 125) { 
document.body.style.zoom = 0.8; 
}

//荣誉资质 
const businessLicense = document.querySelector('.businessLicense');
const businessLicenseBox = document.querySelector('.businessLicenseBox');

businessLicense.addEventListener('click', () => {
businessLicenseBox.style.display = 'block';
setTimeout(() => {
    businessLicenseBox.style.opacity = '1';
}, 10);
});

const businessLicenseClose = document.querySelector('.businessLicenseClose');

businessLicenseClose.addEventListener('click', () => {
businessLicenseBox.style.opacity = '0';
setTimeout(() => {
    businessLicenseBox.style.display = 'none';
}, 300);
});